-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[test] Add a benchmark for SFG edges' two-level map #1927
Conversation
Wow this is interesting to see! It's surprising that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! I'm also surprised to see that there's nothing < 50 ns. Here's my two cents:
- What's the overhead of
TI_PROFILER
-- what about an emptylookup/insert
function with the same parameters? - What about
llvm::SmallVector/SmallSet<std::pair<int, int>, 16>
? I wonder if the indirection caused by nested data structures is the bottleneck.
OK i added
That's a great point.. $ ti test -c benchmark_sfg
They didn't really help :-( |
Here's the result on my laptop:
|
Result on kun:
|
Codecov Report
@@ Coverage Diff @@
## master #1927 +/- ##
==========================================
- Coverage 43.76% 43.72% -0.04%
==========================================
Files 45 45
Lines 6202 6207 +5
Branches 1101 1103 +2
==========================================
Hits 2714 2714
- Misses 3319 3322 +3
- Partials 169 171 +2 Continue to review full report at Codecov.
|
This adds the benchmark for five kind of map implementations:
The test data might not be very representative of the actual use pattern, but it seems to indicate that
llvm::SmallVector<std::pair<Key, llvm::SmallSet<Value>>
is a pretty decent data structure? (I'm too lazy to implement the sortedVector<std::pair<Key, Value>>
. That data structure would require us to sort it for every single insert, otherwise the dedupe process would not be very efficient...)Related issue = #
[Click here for the format server]